package ru.study.thinkin.chapter11;

import java.util.*;


public class QueueDemo {

	public static void printQ(Queue queue) {
		while(queue.peek()!= null) {
			System.out.println(queue.remove()+" ");
		}
		System.out.println();
	}
	
	public static void main(String[] args) {
		Queue<Integer> queue = new LinkedList<Integer>();
		Random rand = new Random();
		for (int i = 0; i<5 ; i++) {
			int value = rand.nextInt(i+20);
			queue.offer(value);
			System.out.println("val="+value);
		}
		System.out.println("==out");
		printQ(queue);
	}

}
